import React from 'react';
import {Icon, message,Modal} from "antd";
const getLabel = WeaLocaleProvider.getLabel;

import './style/';
import {WeaLocaleProvider, WeaTools} from "ecCom";

class CustomApplication extends React.Component {

    state = {
        numberUrlResult:0
    }



    setImgSize = () =>{
        const w = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).width()
        const h = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).height()
        const wp = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).parent().width()
        const hp = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).parent().height()
        if(w > wp || h > hp){
            if(w/h > wp/ hp){
                $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({"width":"100%"})
                const htemp = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).height();
                // $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({ 'margin-top':(hp-htemp)/2+"px"})
            }else if(w/h <=wp/ hp ){
                $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({"height":"100%"})
            }
        }else{

            // $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({"margin-top":(hp-h)/2+"px"})
        }

    }

    componentDidMount(){

        let styles = []
        let newStyle =this.props.container.newStyle
        styles = (newStyle+"").split(",")
        let containerLR =""
        let containerTB = ""
        let applicationLR =""
        let applicationTB = ""
        let logoTextMargin = ""
        if(styles.length == 10){
            containerLR = styles[0]
            containerTB = styles[1]
            applicationLR = styles[2]
            applicationTB = styles[3]
            logoTextMargin = styles[9]
        }



        let lr_customApplication_example_width
        let lr_customApplication_example_height
        let h2 = $("#lr_customer_application_outer_"+this.props.container.id).height()
        let w2 = $("#lr_customer_application_outer_"+this.props.container.id).width()
        if(this.props.container.customApplicationSizeType==1){
            let arr = this.props.container.customApplicationSize.split("*");
            let width
            let height
            if(arr.length ==1){
                width = arr[0]
                height = arr[0]
            }else{
                width = arr[0]
                height = arr[1]
            }
            lr_customApplication_example_width = (w2-((parseInt(100/width)-1)*applicationLR*2))*(width/100)
            lr_customApplication_example_height = (h2-((parseInt(100/height)-1)*applicationLR*2))*(height/100)+"px";
        }else if(this.props.container.customApplicationSizeType==0){
            let arr = this.props.container.customApplicationSize.split("*");
            if(arr.length ==1){
                lr_customApplication_example_width = arr[0]+"px"
                lr_customApplication_example_height = arr[0]+"px"
            }else{
                lr_customApplication_example_width = arr[0]+"px"
                lr_customApplication_example_height = arr[1]+"px"
            }

        }
        $(".lr_customApplication_example_dynamic_size_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({width:lr_customApplication_example_width,height:lr_customApplication_example_height})
        if(this.props.container.customApplicationSizeType==0 && this.props.json.mandatory=='1' && this.props.json.width && this.props.json.width != ""){
            $(".lr_customApplication_example_dynamic_size_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({width:this.props.json.width+"px"})
        }

        const id = this.props.container.id
        const height = $(".lr_customer_application_"+id).height()
        this.props.setStateData({
            ctrlHeight : height
        })
    }



    componentDidUpdate(){
        $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({"width":"auto","height":"auto",'margin-top':'0px'})
        const w = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).width()
        const h = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).height()
        const wp = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).parent().width()
        const hp = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).parent().height()

        if(w > wp || h > hp){
            if(w/h > wp/ hp){
                $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({"width":"100%",})
                const htemp = $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).height();
                // $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({ 'margin-top':(hp-htemp)/2+"px"})

            }else if(w/h <=wp/ hp ){
                $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({"height":"100%"})
            }
        }else{
            // $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({"margin-top":(hp-h)/2+"px"})
        }


        let styles = []
        let newStyle =this.props.container.newStyle
        styles = (newStyle+"").split(",")
        let containerLR =""
        let containerTB = ""
        let applicationLR =""
        let applicationTB = ""
        let logoTextMargin = ""
        if(styles.length == 10){
            containerLR = styles[0]
            containerTB = styles[1]
            applicationLR = styles[2]
            applicationTB = styles[3]
            logoTextMargin = styles[9]
        }



        let lr_customApplication_example_width
        let lr_customApplication_example_height
        let h2 = $("#lr_customer_application_outer_"+this.props.container.id).height()
        let w2 = $("#lr_customer_application_outer_"+this.props.container.id).width()
        if(this.props.container.customApplicationSizeType==1){
            let arr = this.props.container.customApplicationSize.split("*");
            let width
            let height
            if(arr.length ==1){
                width = arr[0]
                height = arr[0]
            }else{
                width = arr[0]
                height = arr[1]
            }
            lr_customApplication_example_width = (w2-((parseInt(100/width)-1)*applicationLR*2))*(width/100)
            lr_customApplication_example_height = (h2-((parseInt(100/height)-1)*applicationLR*2))*(height/100)+"px";
        }else if(this.props.container.customApplicationSizeType==0){
            let arr = this.props.container.customApplicationSize.split("*");
            if(arr.length ==1){
                lr_customApplication_example_width = arr[0]+"px"
                lr_customApplication_example_height = arr[0]+"px"
            }else{
                lr_customApplication_example_width = arr[0]+"px"
                lr_customApplication_example_height = arr[1]+"px"
            }

        }
        $(".lr_customApplication_example_dynamic_size_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({width:lr_customApplication_example_width,height:lr_customApplication_example_height})
        if(this.props.container.customApplicationSizeType==0 && this.props.json.mandatory=='1' && this.props.json.width && this.props.json.width != ""){
            $(".lr_customApplication_example_dynamic_size_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index).css({width:this.props.json.width+"px"})
        }
    }


    urlOnClick = (url,urlType)=>{
        if(this.props.isAddModule == '1'){
            this.props.showManagerSetting(true)
            return
        }
        let target = 'mainFrame'
        let realUrl
        if(urlType == "1"){
            window.open(url, '_blank');
        }else{
            realUrl = this.props.url
            if((realUrl.indexOf(":q")!=-1 ||realUrl.indexOf(":quit")!=-1 ||realUrl.indexOf(":q!")!=-1 || realUrl.indexOf(":quit!")!=-1) && realUrl.indexOf("#")==-1){
                if(window.weaPortalTheme) {
                    window.weaPortalTheme.store.portalThemeStore.onLogout()
                }else{
                    Modal.confirm({
                        title: getLabel(15172, '系统提示'),
                        content: getLabel(16628, '确定要退出系统吗？'),
                        onOk: () => {
                            WeaTools.callApi('/api/hrm/login/checkLogout', 'POST', {}).then((result) => {
                                WeaTools.ssoLogout(result, false);
                            });

                        }
                    });

                }


            }else if((realUrl.indexOf(":t")!=-1 ||realUrl.indexOf(":theme")!=-1 ||realUrl.indexOf(":t!")!=-1 || realUrl.indexOf(":theme!")!=-1) && realUrl.indexOf("#")==-1){
                this.onShowThemeCenter()
            }else{
                window.open(realUrl, '_blank');
            }
        }

    }

    onShowThemeCenter = ()=> {
        const {themeInfo = {}} = window.weaPortalTheme.store.portalThemeStore;

        if (themeInfo.themeAppoint) {
            Modal.confirm({
                title: getLabel(15172, '系统提示'),
                content: getLabel(126325, '分部已指定主题模板，不能修改!')
            });
        } else {
            this.props.WeaThemeCenter.onShow();
        }
    }


    handlerMouseOver = (index)=> {
           $("#lr_edit_"+index ).width($("#lr_logo_"+index ).width()/3)
           $("#lr_edit_"+index ).height($("#lr_logo_"+index ).height()/3)
           let  top = $("#lr_edit_"+index ).height()
           let left = $("#lr_edit_"+index ).width();
           $("#lr_edit_" + index).css("top",top)
           $("#lr_edit_" + index).css("left",left)
           $("#lr_edit_" + index).css("font-size",$("#lr_edit_"+index ).height())
           $("#lr_edit_" + index).show()
           $("#lr_delete_" + index).show()
           $("#lr_logo_"+index ).css("opacity","0.6")

    }

    getNumberLinkResutl = (urlParams)=>{
        const {user={}} = this.props.container
        let strs = urlParams.split('$')
        let url = ""
        let params = {}
        for(let i = 0 ; i< strs.length ;i++){
            let firstIndex  = -1
            let lastIndex = -1
            if((firstIndex=strs[i].indexOf("{")) !=-1 && (lastIndex=strs[i].indexOf("}")) != -1){
                let temp = strs[i].substring(firstIndex+1,lastIndex)
                url += user[temp]
                url += strs[i].substring(lastIndex+1)
            }else{
                url += strs[i]
            }

        }
        strs = url.split("?")
        if(strs.length == 2){
            url = strs[0]
            let temp = strs[1].split("&")
            for(let i = 0 ;i< temp.length ;i++){
                let tempItem = temp[i].split("=")
                if(tempItem.length == 2){
                    params[tempItem[0]] = tempItem[1]
                }
            }
        }

        WeaTools.callApi(url, "GET" ,params).then((result) => {
            let unread = null
            if(this.props.json.showNumberUrlResultName && this.props.json.showNumberUrlResultName != ''){
                let strs = this.props.json.showNumberUrlResultName.split(".")
                for(let i = 0; i< strs.length ; i++){
                    result = result[strs[i]]
                }
                unread = result

            }else{
                unread = result.unread
            }
            if (unread || unread == 0) {
                if(unread && unread >99){
                    this.setState({numberUrlResult:"99+"})
                }else if(unread && unread <=99){
                    this.setState({numberUrlResult:unread})
                }
            }else{
                WeaTools.callApi(url, "POST" ,params).then((result) => {
                    let unread = null
                    if(this.props.json.showNumberUrlResultName && this.props.json.showNumberUrlResultName != ''){
                        let strs = this.props.json.showNumberUrlResultName.split(".")
                        for(let i = 0; i< strs.length ; i++){
                            result = result[strs[i]]
                        }
                        unread = result

                    }else{
                        unread = result.unread
                    }
                    if (unread || unread == 0) {
                        if(unread && unread >99){
                            this.setState({numberUrlResult:"99+"})
                        }else if(unread && unread <=99){
                            this.setState({numberUrlResult:unread})
                        }
                    }


                });
            }


        }).catch((ex) => {
            WeaTools.callApi(url, "POST" ,params).then((result) => {
                let unread = null
                if(this.props.json.showNumberUrlResultName && this.props.json.showNumberUrlResultName != ''){
                    let strs = this.props.json.showNumberUrlResultName.split(".")
                    for(let i = 0; i< strs.length ; i++){
                        result = result[strs[i]]
                    }
                    unread = result

                }else{
                    unread = result.unread
                }
                if (unread != '' && unread != null && !isNaN(unread)) {
                    if(unread && unread >99){
                        this.setState({numberUrlResult:"99+"})
                    }else if(unread && unread <=99){
                        this.setState({numberUrlResult:unread})
                    }
                }


            });
        });

    }

    componentWillMount(){
        if(this.props.showNumberUrl){
            this.getNumberLinkResutl(this.props.showNumberUrl)
        }
    }

    componentWillReceiveProps(nextProps){
        if(nextProps.showNumberUrl){
            this.getNumberLinkResutl(nextProps.showNumberUrl)
        }

    }

    handlerMouseOut = (index)=>{
        $("#lr_edit_" + index).hide()
        $("#lr_logo_"+index ).css("opacity","1")
    }

    render() {
        $("#lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.index).css({width:"auto",height:"auto"})
        const {items} = this.props
        const {customApplicationSizeType,customApplicationSize,openPageHelper,pageSize,setting}  = this.props.container
        let {showType}  =  setting
        let styles = []
        let newStyle =this.props.container.newStyle
        styles = (newStyle+"").split(",")
        let containerLR =""
        let containerTB = ""
        let applicationLR = ""
        let applicationTB = ""
        let containerRadius = ""
        let applicationDivRadius = ""
        let applicationFontColor = ""
        let containerBgi = ""
        let applicationLogoRadius = ""
        let logoTextMargin = ""
        if(styles.length == 10){
            containerLR = styles[0]
            containerTB = styles[1]
            applicationLR = styles[2]
            applicationTB = styles[3]
            containerRadius = styles[4]
            applicationDivRadius = styles[5]
            applicationFontColor = styles[6]
            containerBgi = styles[7]
            applicationLogoRadius = styles[8]
            logoTextMargin = styles[9]
        }
        if(this.props.json.mandatory=='1' && this.props.json.logoTextMarginAfter && this.props.json.logoTextMarginAfter != ""){
            logoTextMargin = this.props.json.logoTextMarginAfter
        }
        if(this.props.json.mandatory=='1' && this.props.json.showTypeAfter!=''){
            showType =  this.props.json.showTypeAfter
        }

        let arr = this.props.container.customApplicationSize.split("*");
        let width
        if(arr.length ==1){
            width = arr[0]
        }else{
            width = arr[0]
        }
        let isFirstRow = false
        let isLastRow = false
        if(this.props.index+1 <= parseInt(100/width)){
            isFirstRow = true
        }
        if(this.props.index+1 > ( Math.ceil(items.length/(parseInt(100/width)))-1)*parseInt(100/width)){
            isLastRow = true
        }
        const containerPadding = containerTB+"px "+containerLR+"px"

        let applicationMargin = applicationTB+"px "+applicationLR+"px"
        if(isFirstRow){
            applicationMargin =  "0px "+applicationLR+"px "+applicationTB+"px "+applicationLR+"px"
        }else if(isLastRow){
            applicationMargin = applicationTB+"px "+applicationLR+"px 0px "+applicationLR+"px"
        }


        if(this.props.container.customApplicationSizeType == 1){

            if(this.props.index == 0  || parseInt(this.props.index+1)%parseInt(100/width) == 1) {

                applicationMargin = applicationTB +"px "+applicationLR+"px "+applicationTB+"px 0px"
                if(isFirstRow){
                    applicationMargin =  "0px "+applicationLR+"px "+applicationTB+"px 0px"
                }else if(isLastRow){
                    applicationMargin = applicationTB +"px "+applicationLR+"px 0px 0px"
                }
            }else if( parseInt(this.props.index+1)%parseInt(100/width) == 0){
                applicationMargin = applicationTB +"px 0px "+applicationTB+"px "+applicationLR+"px"
                if(isFirstRow){
                    applicationMargin = "0px 0px "+applicationTB+"px "+applicationLR+"px"
                }else if(isLastRow){
                    applicationMargin = applicationTB +"px 0px 0px "+applicationLR+"px"
                }
            }
            if(parseInt(100/width )== 1){
                applicationMargin = applicationTB +"px 0px "+applicationTB+"px 0px"
                if(isFirstRow){
                    applicationMargin = "0px 0px "+applicationTB+"px 0px"
                }else if(isLastRow){
                    applicationMargin = applicationTB +"px 0px 0px 0px"
                }
            }


        }else if(this.props.container.customApplicationSizeType == 0){
            let isHasMargin = this.props.isHasMargin
            if(isHasMargin == 0){
                applicationMargin = applicationTB +"px "+(parseInt(applicationLR)*2)+"px "+applicationTB+"px 0px"
            }else if(isHasMargin == 1) {
                applicationMargin =   applicationTB +"px 0px "+applicationTB+"px 0px"
            }

            // let isHasMargin = this.props.isHasMargin
            // if(isHasMargin == 0){
            //     applicationMargin = applicationTB +"px "+applicationLR+"px "+applicationTB+"px 0px"
            //     if(this.props.items.length == 1){
            //         applicationMargin = applicationTB +"px 0px "+applicationTB+"px 0px"
            //     }
            // }else if(isHasMargin == 2){
            //     applicationMargin = applicationTB +"px 0px "+applicationTB+"px "+applicationLR+"px"
            // }else if(isHasMargin == 4){
            //     applicationMargin = applicationTB +"px 0px "+applicationTB+"px 0px"
            // }

        }
        const containerRadiusReal = containerRadius+"px"
        const applicationDivRadiusReal = applicationDivRadius+"px"
        const applicationFontColorReal = "#"+applicationFontColor
        const containerBgiReal = containerBgi
        const applicationLogoRadiusReal = applicationLogoRadius+"px"




        return (
                       this.props.authority == 1 ? (
                       this.props.index != this.props.itemCount ? <div  style={{display:'inline-block',width:'180px',height: '150px','text-align':'center','background-color':this.props.bgc}}>
                           <div style={{width:'100%',height: '100%'}}>
                               <div style={{'line-height': 'center' ,width: '100%',height:'25%'}}></div>
                               <div style={{display: 'inline-block',width: '50%',height: '50%',position:"relative",cursor:"move"}} onMouseOver={()=>{this.handlerMouseOver(this.props.index)}} onMouseOut={() =>{this.handlerMouseOut(this.props.index)}}>
                                   <i id={"lr_edit_"+this.props.index} className="icon-coms-Need-feedback"  style={{position:"absolute",display:"none",'z-index':"3",'cursor':'pointer'}}  title={getLabel(26473, '编辑')} onClick={(e) => {this.props.setAddVisiableAndEditItem(this.props.index)}}/>
                                   <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@qmuqkc`} id={"lr_delete_"+this.props.index} type="cross" style={{top: "-10px",
                                       right: "-10px",
                                       width: "20px",
                                       height: "20px",
                                       "line-height": "20px",
                                       "font-size": "13px",
                                       "border-radius": "10px","background-color":"gray",position:"absolute",'z-index':'3','color':'#ffffff','cursor':'pointer'}} title={getLabel(91, '删除')} onClick={(e) => {this.props.deleteApplicationById(this.props.index,this.props.id)}}/>
                                   <img id={"lr_logo_"+this.props.index} src={this.props.logo} style={{width:'100%',height: '100%'}}/>

                               </div>
                               <div style={{width: '100%',height:'25%'}} >
                                   <span style={{'display':'inline-block','line-height':'45.5px','font-size':'17px','color':this.props.customApplicationFontColor}}>{this.props.text}</span>
                               </div>
                           </div>
                       </div>
                           :<div   style={{display:'inline-block',width:'180px',height: '150px','text-align':'center'}}>
                               <div style={{width:'100%',height: '100%'}}>
                                   <div style={{'line-height': 'center' ,width: '100%',height:'25%'}}></div>
                                   <div style={{display: 'inline-block',width: '50%',height: '50%',position:"relative",cursor:"pointer"}} >
                                      {/*<img   style={{width:'100%',height: '100%'}} onClick={this.addCustomeApplicationExample}/>*/}

                                   </div>
                                   <div style={{width: '100%',height:'25%'}} >
                                       <span onClick={this.props.addCustomeApplicationExample}>+++++++</span>
                                   </div>
                               </div>
                           </div>

                       ):(
                               <div className={"lr_customApplication_example_"+this.props.container.id+" lr_customApplication_example_class lr_customApplication_example_dynamic_size_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index} onClick={()=>{this.urlOnClick(this.props.url,this.props.urlType)}} style={{position:'relative','background-color':this.props.bgc,margin:applicationMargin,'border-radius':applicationDivRadiusReal}}>
                                       <div style={{display:'inline-block','vertical-align':'middle'}}>
                                            <div  className={"lr_customApplication_example_div2_"+this.props.container.id+" lr_customApplication_example_div2_class"}  >
                                                       <img id={"lr_customApplication_example_div2_img_"+this.props.container.id+"_"+this.props.outIndex+"_"+this.props.index} src={this.props.logo} className={"lr_customApplication_example_div2_img_class"} style={{display:'inline-block','border-radius':applicationLogoRadiusReal}} onLoad={this.setImgSize}/>
                                                       {
                                                           (((this.props.json.mandatory == '0' && setting.showType == "0") || (this.props.json.mandatory == '1' && this.props.json.showTypeAfter=='0')) && this.state.numberUrlResult != 0)
                                                               ? (<span className={"lr_customApplication_showNumberUrl_resutl_"+this.props.container.id+" lr_customApplication_example_div2_img_number_class"} style={{left:setting.unreadPositionLeft+'px',top:setting.unreadPositionTop+'px','font-size':setting.noReadCountFontSize+'px','color':setting.unreadCountFontColor,'background-color':setting.unreadCountBgColor,'border-radius':setting.unreadCountRadius+'px',width:setting.unreadWidth+'px',height:setting.unreadHeight+'px',border:setting.unreadBorderWidth+'px solid '+setting.unreadBorderColor}}>{this.state.numberUrlResult}</span>)
                                                               :""
                                                       }
                                                {
                                                    ((this.props.json.mandatory == '0' && setting.showType == "1") || (this.props.json.mandatory == '1' && this.props.json.showTypeAfter=='1')) ? (
                                                        <div style={{display:'inline-block','text-align':'right','vertical-align':'middle','color': applicationFontColorReal,'margin-left':logoTextMargin+"px"}}>
                                                            <div style={{'font-size':setting.titleFontSize}}>{this.props.text}</div>
                                                            {
                                                                this.state.numberUrlResult != 0? (
                                                                   <div style={{'font-size':setting.noReadTitleFontSize}}> {this.props.json.noReadTitle ?(this.props.json.noReadTitle.replace('${n}',this.state.numberUrlResult)):this.state.numberUrlResult}</div>
                                                               ): null
                                                            }

                                                        </div>
                                                    ):(
                                                        ""
                                                    )
                                                }
                                                {/*{*/}
                                                    {/*showType == "1" ? (*/}
                                                        {/*<div style={{display:'inline-block','text-align':'right','vertical-align':'middle','color': applicationFontColorReal,'margin-left':logoTextMargin+"px"}}>*/}
                                                            {/*<div style={{'font-size':setting.titleFontSize+"px"}}>{this.props.text}</div>*/}
                                                            {/*{*/}
                                                                {/*this.props.json.noReadTitle ? (*/}
                                                                    {/*<div style={{'font-size':setting.noReadTitleFontSize+"px"}}>{this.props.json.noReadTitle.replace(' n ',12)}</div>*/}
                                                                {/*):(*/}
                                                                    {/*""*/}
                                                                {/*)*/}
                                                            {/*}*/}

                                                        {/*</div>*/}
                                                    {/*):(*/}
                                                        {/*""*/}
                                                    {/*)*/}
                                                {/*}*/}

                                           </div>
                                           {
                                               ((this.props.json.mandatory == '0' && setting.showType == "0") || (this.props.json.mandatory == '1' && this.props.json.showTypeAfter=='0')) ? (
                                                   <div className={"lr_customApplication_text_span_new_" + this.props.container.id +" lr_customApplication_text_span_span_class"} style={{"width": "100%", "text-align": "center",'color': applicationFontColorReal,'font-size':setting.titleFontSize+"px",'margin-top':logoTextMargin+"px"}}>
                                                       {this.props.text}
                                                   </div>
                                               ):(
                                                   ""
                                               )

                                           }

                                       </div>
                                   <div style={{display:'inline-block','vertical-align':'middle','height':'100%'}}></div>

                           </div>
                       )

        );
    }



}

export default CustomApplication;